#include <iostream>
#include <numeric>
#include <vector>
//
// Created by lingzhitech on 25-9-23.
//
int main() {
    std::vector<double> vec = {1.2, 2.3, 4.5, 6.7, 8.9, 10};
    //double will be converted to int when init argument is 0
    double sum = std::accumulate(vec.cbegin(), vec.cend(), 0);
    std::cout << "The sum " << sum << std::endl;
}